﻿
@{
    ViewBag.MenuId = 1;
    Layout = "";
}

<style>
    .swiper-container {
        width: 100%;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .swiper-slide {
        background-position: center;
        background-size: cover;
        width: 80%;
        /*height: 118px;*/
        border-radius: 5px;
    }

        .swiper-slide img {
            width: 100%;
            border-radius: 5px;
        }

    .swiper-pagination-bullet {
        background: #fff;
        opacity: 1;
    }

    .swiper-pagination-bullet-active {
        background: #eb272a;
    }

    .flayout_l_threelProBox {
        margin-bottom: 10px;
    }
</style>
<div ng-controller="ActivityIndexController">
    <div class="f_mb60">
        <!-- Swiper -->
        <div>
            <div>
                <carousel interval="myInterval">
                    <slide ng-repeat="slide in slides" active="slide.active">
                        <img ng-src="{{slide.image}}"  ng-click="go(slide.url)" style="margin: auto;" alt="" />
                    </slide>
                </carousel>
            </div>
        </div>


        <!-- 拼团活动 -->
        <div class="flayout_l_threel">
            <div class="flayout_l_threelProBox" ng-repeat="model in dt">
                <div class="l_threelProImg"><img src="{{ImgHostUrl+model.CoverImg}}" alt=""></div>
                <div class="l_threelProInfo">
                    <p class="l_threelProName">{{model.Title}}</p>
                    <p class="l_threelProtags">{{model.ProductDescription}}</p>
                    <div class="l_threelProBottom">
                        <span class="threelProprice1">¥</span><span class="threelProprice2">{{model.FloorPrice}}</span><label class="threelProprice3">¥{{model.OriginalPrice}}</label>
                        <div class="l_threelProBtns">
                            <span class="left"><img src="/Content/images/f_73.png"><label>{{model.TeamCount}}人参加</label></span>
                            <a href="javascript:void(0)" ng-click="opengroup(model.DropGroupID)" class="right">立即开团</a>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--end 拼团活动 -->


    </div>

    <div class="flayout_l_threel" ng-show="isshow==0" style="display:none">
        <div class="ac_emptyBox">
            <img src="/Content/images/ac_empty.jpg" alt="活动为空">
            <div class="go_other"><a href="javascript:void(0)" ng-click="goindex()">去看看其他活动吧！！！</a></div>
        </div>
    </div>
    <!-- 底部 -->
    @Html.Partial("_dgfoot")
    <!--end 底部 -->
   
</div>

<script>


    App.controller('ActivityIndexController', [
           '$scope', '$http', '$rootScope', '$stateParams', '$state', '$filter', '$timeout',
       function ($scope, $http, $rootScope, $stateParams, $state, $filter, $timeout) {

           $scope.dt = [];
           $scope.isshow = 1;


           $http.post("/Activity/GetPointCarouselList", { type :5}).then(function (response) {
               if (response.data.isSuccess) {

                   $scope.CarouselList = response.data.data;
               }
               // 设置轮播图图片间隔
               $scope.myInterval = 5000;
               // 轮播图数据初始化
               var slides = $scope.slides = [];
               // 添加轮播图源
               
               if ($scope.CarouselList.length > 0) {
                   angular.forEach($scope.CarouselList, function (img) {
                       slides.push({ image: $rootScope.ImgHostUrl + img.ImgUrl,url:img.LinkUrl });
                   });
               }



           });

           $scope.goindex = function (aid, id) {
               $state.go('shop.index');
           }

           $http.post("/DropGroup/GetDropGroupListAll", {}).then(function (response) {
               if (response.data.Results && response.data.Results != "") {
                   $scope.dt = response.data.Results;
                   if ($scope.dt.length == 0) {
                       $scope.isshow = 0;
                   }
               } else {
                   $scope.isshow = 0;
               }
           });

           $scope.opengroup = function (id) {
               $state.go('activity.dropgroupinfo', { "Id": id });
           }
         
           $scope.go = function (url) {
               location.href = url;
           }
           var tt = function () {
               $rootScope.WxShare($rootScope.pageTitle(), '优品三悦', location.href, $rootScope.LogoUrl);
           }

           setTimeout(tt, 1000)
       }]);

   


</script>